package com.atguigu.gmall.item.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Description:
 * @author: JC
 * @date: 2021/10/29 18:38
 */

@Configuration
public class ThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor  threadPoolExecutor(){
         return new ThreadPoolExecutor(
                 6,
                 12,
                 5,
                 TimeUnit.SECONDS,
                 new ArrayBlockingQueue<>(6)
         );
    }
}
